# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=kjournald
pkgver=24.08.2
pkgrel=0
pkgdesc="Framework for interacting with systemd-journald"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
url="https://invent.kde.org/system/kjournald"
license="BSD-3-Clause AND LGPL-2.1-or-later AND MIT"
depends_dev="
	kcoreaddons-dev
	ki18n-dev
	qt6-qtbase-dev
	qt6-qtdeclarative-dev
	systemd-dev
	"
makedepends="$depends_dev
	extra-cmake-modules
	samurai
	"
checkdepends="xvfb-run"
subpackages="$pkgname-dev $pkgname-lang"

case "$pkgver" in
	*.90*) _rel=unstable;;
	*) _rel=stable;;
esac
_repo_url="https://invent.kde.org/system/kjournald.git"
source="https://download.kde.org/$_rel/release-service/$pkgver/src/kjournald-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure -E "test_(viewmodel|filtercriteriamodel|remotejournal)"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
5bd8a122362c20dd3cb10bb9a28596d31686782c309834a1c596f80f515574c3d6f3937163008c02191666e8be465ff64784a99deb7ef886daf1e54e947256ae  kjournald-24.08.2.tar.xz
"
